package br.com.firula.web.filter;

import javax.servlet.http.HttpSessionEvent;
import javax.servlet.http.HttpSessionListener;

import org.apache.log4j.Logger;


public class SessionCounter implements HttpSessionListener {
    
    static Logger logger = Logger.getLogger(SessionCounter.class);
    
    private static int activeSessions = 0;
    
    public void sessionCreated(HttpSessionEvent se) {
        activeSessions++;
        System.out.println("as:" + activeSessions);
    }
    
    public void sessionDestroyed(HttpSessionEvent se) {
//    	if(activeSessions > 0)
            activeSessions--;
    	System.out.println("as:" + activeSessions);
    }
    
    public static int getActiveSessions() {
        return activeSessions;
    }
    
    
}
